Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic refresh #1026

Merged
merged 11 commits into from
Jul 5, 2024
Merged

Automatic refresh #1026

merged 11 commits into from
Jul 5, 2024

Conversation

micbakos-rdx
Copy link
Contributor

Description

  • The wallet screen refreshes the assets every 5 minutes and the account screen every 1 minute
  • The "refresh timer" starts counting from the last time a previous refresh occurred. Meaning that if the user does a manual refresh meanwhile then the timer restarts.
  • Errors are not shown when an automatic refresh occurs.
  • Substantial changes to the WalletViewModel regarding the structure of state and how it is represented. More detailed types for refresh and price state exist and give more flexibility to preserve state and convey it to the user.

How to test

  1. Open wallet from scratch
  2. Reopen wallet
  3. Play around with refresh
  4. Do the same with account screen

Copy link
Contributor

@sergiupuhalschi-rdx sergiupuhalschi-rdx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Contributor

@giannis-rdx giannis-rdx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent job! 🍀

Comment on lines +101 to +103
observeAccountAssets()
observeGlobalAppEvents()
observeSecurityPrompt()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. 👍🏽

@@ -110,7 +105,7 @@ class WalletViewModel @Inject constructor(
}
}
observePrompts()
observeAccounts()
observeWallet()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only objection is here. "wallet" is quite generic. It seems like observing everything in the wallet?
If not observeAccounts then maybe observeWalletAssets?

Copy link

sonarcloud bot commented Jul 5, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 40%)

See analysis details on SonarCloud

@micbakos-rdx micbakos-rdx merged commit 6341ec3 into main Jul 5, 2024
8 of 9 checks passed
@micbakos-rdx micbakos-rdx deleted the account-refresh branch July 5, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants